#author Jorge Conduto

d1 = {'Programaca5o 1' : 10,
      'Programacao 2' : 10,
      'Matematica' : 10,
      'Linguagens de programacao' : 10}

media = 0.0
c = 0
for valor in d1.itervalues():
    media += valor
    c += 1
media /= c

print "media =" , media
for chave, valor in d1.iteritems():
        print chave, valor
#  exerc 2
# exemplo para criar

def gerar_cubos (N):
    for i in range (N):
        yield i ** 3

gen = gerar_cubos (5)

#print gen.next ()
#print gen.next ()
#print gen.next ()
#print gen.next ()
#print gen.next ()

print
for y in gerar_cubos (5):
    print y


# exerc 2

def gerar_notas (N):
    for i in range (N):
        yield i ** 2

disciplinas = filter(gerar_notas, [ 'LP', 'EDA'])

print (disciplinas)        
